#include "shapes.h"
#include "canvas.h"

Dot::Dot(Canvas* c, const Point& p) :
	mCanvas(c)
{
	mPoint = new Point(p);
}

Dot::~Dot()
{
	delete mPoint;
}

void Dot::draw(int style)
{
	mCanvas->drawDot(mPoint, style);
}

Line::Line(Canvas* c, const Point& start, const Point& end) :
	mCanvas(c)
{
	mPointStart = new Point(start);
	mPointEnd = new Point(end);
}

Line::~Line()
{
	delete mPointStart;
	delete mPointEnd;
}

void Line::draw(int style)
{
	mCanvas->drawLine(mPointStart, mPointEnd, style);
}

Rectangle::Rectangle(Canvas* c, const Point& start, const Point& end) :
	mCanvas(c)
{
	mPointStart = new Point(start);
	mPointEnd = new Point(end);
}

Rectangle::~Rectangle()
{
	delete mPointStart;
	delete mPointEnd;
}

void Rectangle::draw(int style)
{
	mCanvas->drawRectangle(mPointStart, mPointEnd, style);
}
